package com.superzqb.asus.superzqbFragment.superzqbSave;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.superzqb.asus.superzqb.R;

public class AddAim extends Activity implements View.OnClickListener{
    private Context context;
    private LinearLayout buy,trip,save,myAim;
    private ImageView back;
    private TextView title;
    public final static int buyFlag=1,tripFlag=2,saveFlag=3,myAimFlag=4;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.add_aim);
        initView();
    }

    private void initView() {
        context=AddAim.this;
        back=(ImageView)findViewById(R.id.back);
        title=(TextView)findViewById(R.id.title);
        title.setText("设置我的攒钱目标");
        buy=(LinearLayout) findViewById(R.id.buy);
        trip=(LinearLayout) findViewById(R.id.trip);
        save=(LinearLayout) findViewById(R.id.save);
        myAim=(LinearLayout) findViewById(R.id.myAim);


        back.setOnClickListener(this);
        buy.setOnClickListener(this);
        trip.setOnClickListener(this);
        save.setOnClickListener(this);
        myAim.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent=new Intent();
        intent.setClass(context,SubmitMyAim.class);
        switch (v.getId()){
            case R.id.back:
                finish();
                break;
            case R.id.buy:
                intent.putExtra("flag",buyFlag);
                startActivity(intent);
                break;
            case R.id.trip:
                intent.putExtra("flag",tripFlag);
                startActivity(intent);
                break;
            case R.id.save:
                intent.putExtra("flag",saveFlag);
                startActivity(intent);
                break;
            case R.id.myAim:
                intent.putExtra("flag",myAimFlag);
                startActivity(intent);
                break;
            default:break;
        }
    }
}
